{% extends "base/base.html" %}

{% comment %}

 Copyright 2013 - Tom Alessi

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and 
 limitations under the License.

{% endcomment %}

{% block content %}
		
<form method="POST" action="/admin/logo_config">
{% csrf_token %}

<div class="row">
	{# This is a large-3 side nav #}
	{% include "admin/side_nav.html" %}

	<div class="large-9 columns">

    <div class="row">
      <div class="large-12 columns">
        <h1>Logo Configuration</h1>
        <p>Complete the relevant fields below to display a custom company logo on all pages.</p>
        <hr>
      </div>
    </div>

    {# This is row consisting of 12 columns that will display all messages passed in the request #}
    {% include "admin/messages.html" %}

    <div class="row">
      <div class="large-12 columns">
        <span class="radius secondary label">Logo Url</span><br>
        <div class="sublabel_container"><span class="sublabel">The logo url can be a fully qualified domain name (e.g. www.domain.com/logo.png) or a relative path if you have placed the image file on the local file system (e.g. /html/images/logo.png).</span></div>
      </div>
    </div>
		
		<div class="row">
			<div class="large-8 columns {% if form.url.errors %}error{% endif %}">
		 		<input type="text" name="url" maxlength="250" placeholder="Enter a logo url" value="{% if form.url.data %}{{form.url.data}}{% else %}{{logo_config.0.url}}{% endif %}" />
		    {% if form.url.errors %}
        <span class="err">{% for error in form.url.errors %}{{error}}<br>{% endfor %}<br></span>
		    {% endif %} 
		  </div>
		</div>

    <div class="spacer_medium"></div>

    <div class="row">
      <div class="large-12 columns">
        <span class="radius secondary label">Logo Url Enabled</span><br>
        <div class="sublabel_container"><span class="sublabel">If enabled, the logo will be displayed in the header of all pages, just below the navigation links.</span></div>
      </div>
    </div>

		<div class="row">
			<div class="large-12 columns {% if form.logo_enabled.errors %}error{% endif %}">
       <label><input type="checkbox" name="logo_enabled" {% if form.logo_enabled.data %}checked{% else %}{% if logo_config.0.logo_enabled %}checked{% endif %}{% endif %} />
        Enabled</label>
        {% if form.logo_enabled.errors %}
        <span class="err">{% for error in form.logo_enabled.errors %}{{error}}<br>{% endfor %}<br></span>
        {% endif %}
			</div>
		</div>

  	<div class="spacer_small"></div>

    <div class="row">
		  <div class="large-11 columns">
		    <input type="submit" class="small button" value="Save"/>
		  </div>
		</div>
		
	</div>
</div>

</form>

{% endblock %}



